Fix failed reboot silently starting a second parallel capture in continuous mode#919
Open
Cybis320 wants to merge 2 commits into
Open
Fix failed reboot silently starting a second parallel capture in continuous mode#919Cybis320 wants to merge 2 commits into
Cybis320 wants to merge 2 commits into
Conversation
os.system('sudo shutdown -r now') never raises on command failure, so a
failed reboot (e.g. no sudo rights under a systemd service user) was
silently retried 240 times in a few seconds before capture resumed.
Log an error with the exit code and stop retrying, since a permission
failure will not heal on retry.
runCapture returned with BufferedCapture still running, relying on the imminent reboot to kill it. If the reboot failed, the resume path started a second capture in parallel: every frame was saved twice, and the old capture (holding the previous daytime_mode) stamped a stale day/night suffix on its copies. The interleaved _d/_n duplicates then shattered timelapse block grouping into 1-2 frame blocks that fail the 10-image minimum and are rescanned every night.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reboot_after_processing runs os.system('sudo shutdown -r now') without checking the exit code. When the command fails (e.g. no sudo rights under a systemd service user), the failure is invisible and capture resumes — but runCapture had returned with the old BufferedCapture still running, so a second capture starts in parallel. Every frame is then saved twice, and the old capture (holding a stale daytime_mode) labels its copies with the wrong _d/_n suffix. The interleaved duplicates shatter timelapse block grouping into 1–2 frame blocks that fail the 10-image minimum, are never cleaned up, and get rescanned every night (observed on a live station: ~96k warnings and a 40 MB log per night).
Two changes: